package com.zsk.shop.api.pay.common.enums;

/**
 * @author lixiaoguang
 * @version $Id: PayTypeEnum.java, v 0.1 2017年9月7日 下午8:12:30 lixiaoguang Exp $
 */
public enum RefundStatusEnum {

    NONE("未退款", "未申请退款", 0),

    HANDLE("退款处理中", "用户申请退款", 1),

    REFUSE("商家拒绝退款", "用户申请退款-商家已拒绝", 2),

    AGREE("已同意退款", "用户申请退款-商家已退款", 3),

    ;

    private String name;
    private String sellerName;
    private int code;

    RefundStatusEnum(String name, String sellerName, int code) {
        this.name = name;
        this.sellerName = sellerName;
        this.code = code;
    }

    /**
     * 根据code获取name
     *
     * @param code
     * @return
     */
    public static String getDescByCode(Integer code) {
        for (RefundStatusEnum object : RefundStatusEnum.values()) {
            if (code.equals(object.getCode())) {
                return object.getName();
            }
        }
        return null;
    }

    /**
     * 根据code获取name
     *
     * @param code
     * @return
     */
    public static String getSellerDescByCode(Integer code) {
        for (RefundStatusEnum object : RefundStatusEnum.values()) {
            if (code.equals(object.getCode())) {
                return object.getSellerName();
            }
        }
        return null;
    }


    public String getSellerName() {
        return sellerName;
    }

    public void setSellerName(String sellerName) {
        this.sellerName = sellerName;
    }

    /**
     * Getter method for property <tt>name</tt>.
     *
     * @return property value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Setter method for property <tt>name</tt>.
     *
     * @param name value to be assigned to property name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Getter method for property <tt>code</tt>.
     *
     * @return property value of code
     */
    public int getCode() {
        return code;
    }

    /**
     * Setter method for property <tt>code</tt>.
     *
     * @param code value to be assigned to property code
     */
    public void setCode(int code) {
        this.code = code;
    }

}
